#pragma once


#include "Expression.h"

#include <unordered_map>


class Bank
{
public:
	ExpressionSp Reduce( const Expression& cExpression, const std::tstring& cstrCurrency ) const;
	void AddRate( const std::tstring& cstrFrom, const std::tstring& cstrTo, int iRate );
	int FindRate( const std::tstring& cstrFrom, const std::tstring& cstrTo ) const;


private:
	class Pair : public std::pair<std::tstring, std::tstring>
	{
	public:
		Pair( const std::tstring& cstrFrom, const std::tstring& cstrTo );

		operator size_t() const;

	}; // class Pair

	typedef std::unordered_map<Pair, int> PairMap;


	PairMap m_mRates;

}; // class Bank
